import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:tot_android_flutter/utils/utils_ext.dart';
import 'package:get/get.dart';
import 'package:tot_android_flutter/router/AppRoutes.dart';

import 'injection.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Injection().init();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return ScreenUtilInit(
      designSize: const Size(360, 720),
      // designSize: const Size(1920, 1080),
      builder: (context, child) => GetMaterialApp(
        // 网格
        debugShowMaterialGrid: false,
        // Debug标志
        debugShowCheckedModeBanner: true,
        // 打开性能监控，覆盖在屏幕最上面
        showPerformanceOverlay: false,
        // 语义视图（无障碍）
        showSemanticsDebugger: false,
        localeListResolutionCallback: (locales, supportedLocales) {
          print('当前地区语言$locales');
          print('设备支持的地区语言$supportedLocales');
          return null;
        },
        initialRoute: AppPages.INITIAL,
        getPages: AppPages.routes,
      ),
    );
  }
}
